package com.zhima.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.zhima.enums.SubTaskState;
import com.zhima.enums.TaskTotalState;
import com.zhima.typehandler.SubTaskExecuteInfoListTypeHandler;
import com.zhima.typehandler.SubTaskStateListTypeHandler;
import lombok.Data;

import java.util.List;

@Data
@TableName(value = "task", autoResultMap = true)
public class LocalTask {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String taskType;
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> businessKeys;
    private TaskTotalState taskTotalState;
    @TableField(typeHandler = SubTaskStateListTypeHandler.class)
    private List<SubTaskState> subTaskStates;
    @TableField(typeHandler = SubTaskExecuteInfoListTypeHandler.class)
    private List<SubTaskExecuteInfo> subTaskExecuteInfos;
    private Integer nextSubTaskIndex;
}
